<?php

/**
 * 订单业务类
 * 
 */
class OrderModel extends Model{
	
	public function get_order_detail_byid($order_id){
		$sql	=	"
					SELECT a1.order_id,a1.order_sn,a1.order_status,a1.order_amount,a1.goods_amount,a1.address,a1.tel,a1.consignee,a1.order_status,a1.pay_status,a1.pay_id,
					b1.region_name country_name,b2.region_name province_name,b3.region_name city_name,b4.region_name district_name
					FROM ybr_order_info a1
					LEFT JOIN ybr_region  b1 on b1.region_id = a1.country
					LEFT JOIN ybr_region  b2 on b2.region_id = a1.province
					LEFT JOIN ybr_region  b3 on b3.region_id = a1.city
					LEFT JOIN ybr_region  b4 on b4.region_id = a1.district
					WHERE a1.order_id = '{$order_id}' limit 1
					";
		$datas 	=	M()->query($sql);
		return empty($datas) ? array() : $datas[0];
	}
	
}



